<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<meta name="format-detection" content="telephone=no, address=no, email=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="misapplication-tap-highlight" content="no" />
		<meta name="HandheldFriendly" content="true" />
		<link rel="stylesheet" href="../../css/mui.min.css" type="text/css" charset="utf-8" />
		<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
		<link rel="stylesheet" href="../../css/product.css" type="text/css" charset="utf-8" />
		<style> .mui-table-view .mui-table-view-cell { margin-bottom: 0.14rem; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; background: #fff; }  .mui-table-view .mui-table-view-cell a { color: #666; }  </style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav" style="padding: 0px;height: 3.02rem;">
			<div class="header" style="height: 3.02rem;">
				<div class="mui-header text-center" style="background:none;padding-top:0.27rem">
					<div class="title">个人中心</div>
					<div class="text-center personInfo" style="margin-top:0.86rem;">
						<p class="title" id="name"></p>
						<p id="mobile"></p>
					</div>
				</div>

			</div>
		</header>
		<div class="mui-content" style="margin-top:2.64rem;padding-left:0rem;padding-right:0rem;">

			<ul class="mui-table-view mui-table-view-chevron">
				<li class="mui-table-view-cell" id="personInfo">
					<a href="javascript:;" class="mui-navigate-right">个人资料</a>
				</li>
				<li class="mui-table-view-cell" id="msgCenter">
					<a href="javascript:;" class="mui-navigate-right">消息中心</a>
				</li>
				<li class="mui-table-view-cell" id="personSafe">
					<a href="javascript:;" class="mui-navigate-right">安全</a>
				</li>
				<li class="mui-table-view-cell" id="msgSetting">
					<a href="javascript:;" class="mui-navigate-right">修改手机号</a>
				</li>
			</ul>

			<div class="mui-button-row" style="position:absolute;bottom:1.35rem;left:0.24rem;right:0.24rem;">
				<button type="button" class="mui-btn mui-btn-primary mui-btn-full" id="register" style="height:44px;border-radius:0px;background:#f1c40f;color:#fff;border-color:#f1c40f" onclick="logout()">退出登录</button>
			</div>
			
			 
			<nav class="mui-bar mui-bar-tab">
		        <a class="mui-item" id="homeIndex"  > <span class="pic-icon pic-icon-home"></span> <span class="mui-tab-label">主页</span> </a>
				<a class="mui-item" id="main-inout" > <span class="pic-icon pic-icon-inout"></span> <span class="mui-tab-label">出入库</span> </a> 
				<a class="mui-item" id="main-jxs"  > <span class="pic-icon pic-icon-jxs"></span> <span class="mui-tab-label">经销商</span> </a> 
				<a class="mui-item  mui-active" id="main-center"  > <span class="pic-icon pic-icon-person"></span> <span class="mui-tab-label">个人中心</span> </a>
		   </nav>
		</div>
	</body>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/resize.js"></script>
	<script src="../../js/app.js"></script>
	<script src="../../js/footer.js"></script>
	<script src="../../js/ajaxFun.js"></script>
	<script type="text/javascript">
		
		(function($, doc) {
			$.plusReady(function() {
				plus.nativeUI.closeWaiting();
				mui.init({
				    beforeback: function(){
				    	var wobj = plus.webview.getWebviewById("main-inout");
						if(!wobj) {
							wobj = plus.webview.create('./inout/index.html', 'main-inout');
						}
						wobj.reload(true);
				        return true;
				    } 
				});
				mui.back=function(){
					openWindow('../home/index.html','homeIndex','','slide-in-left');
					return false;
				}
				var mainPage;
				var pageArray={
					personInfo:'personInfo.html',
					msgCenter:'msgCenter.html',
					msgSetting:'msgSetting.html',
					personSafe:'personSafe.html'
				}
			 
				var toPage = function() {
					//使用定时器的原因：
					//可能执行太快，main页面loaded事件尚未触发就执行自定义事件，此时必然会失败
					var id = setInterval(function() {
						clearInterval(id);
						mui.fire(mainPage, 'show', null);
						mainPage.show("pop-in");
					}, 200);
				};

				var list = document.querySelectorAll('.mui-table-view-cell');
				for(var i = 0; i < list.length; i++) {
					var temp = list[i];
					temp.addEventListener('tap', function() {
						var id = this.getAttribute('id');
						for(key in pageArray){
							if(id==key){
								openWindow(pageArray[id],id);
							}
						}
					})
				}

				//获取个人信息
				var self = JSON.parse(localStorage.getItem('$users') || '[]');
				/*获取个人资料*/
				var url = baseUrl + 'traderInfoController/getInfo.do';
				var data = {};
				ajaxFun.postFun(url, data, '', function(data) {
					data = data.data.dataList[0];
					document.getElementById("name").innerHTML = data.name;//个人信息赋值
					document.getElementById("mobile").innerHTML = data.mobile;//个人信息赋值
					self.nickname=data.name;
					self.mobile=data.mobile;
					localStorage.setItem('$users', JSON.stringify(self));
				});
			})
		}(mui, document))
		
		function logout(){
			app.logout();
		}
	</script>

</html>